import request from "@/utils/request";

// 查询设备列表
export function listDeviceData(query) {
  return request({
    url: "business/device/list",
    method: "get",
    params: query,
  });
}

// 查询设备详细
export function getDeviceData(deviceId) {
  return request({
    url: "business/device/" + deviceId,
    method: "get",
  });
}

// 新增设备
export function addDeviceData(data) {
  return request({
    url: "business/device",
    method: "post",
    data: data,
  });
}

// 修改设备
export function updateDeviceData(data) {
  return request({
    url: "business/device",
    method: "put",
    data: data,
  });
}

// 删除设备
export function delDeviceData(deviceId) {
  return request({
    url: "business/device",
    method: "delete",
    data: deviceId,
  });
}

// 设备系统分类下面的各个设备类型下面的设备的数量
export function statDeviceTypeUnderDeviceNum(data) {
  return request({
    url: "business/device/statDeviceTypeUnderDeviceNum",
    method: "get",
    params: data,
  });
}

// 保存设备关联(目前只有是摄像头设备才能去关联其他设备)
export function setAssociationDevice(data) {
  return request({
    url: "business/associationDevice",
    method: "post",
    data: data,
  });
}